package com.chixing.ih.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: icanci
 * @ProjectName: ic-es-jd
 * @PackageName: cn.icanci.config
 * @Date: Created in 2020/7/21 7:52
 * @ClassAction:
 */
@Configuration
public class ElasticSearchConfig {
    @Bean
    public RestHighLevelClient restHighLevelClient() {
        RestHighLevelClient restHighLevelClient = new RestHighLevelClient(
                RestClient.builder(
                        new HttpHost("39.99.219.59", 9200, "http")
                )
        );
        return restHighLevelClient;
    }
}
